{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 云试色"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 试唇色--腾讯人脸试妆API"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 调用代码块\n",
    "from tencentcloud.common import credential\n",
    "from tencentcloud.common.profile.client_profile import ClientProfile\n",
    "from tencentcloud.common.profile.http_profile import HttpProfile\n",
    "from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException \n",
    "from tencentcloud.fmu.v20191213 import fmu_client, models "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{\"ResultImage\": \"\", \"ResultUrl\": \"https://faceeffect-1254418846.cos.ap-guangzhou.myqcloud.com/1300110354/1594917609466/EhilxT4pxl8gD\", \"RequestId\": \"e6526f99-2455-445b-8e66-7fa6e6135e5d\"}\n"
     ]
    }
   ],
   "source": [
    "try: \n",
    "    cred = credential.Credential(\"AKIDkEXjvqzx83i5PfCMnysXu8HJ4ZqsL7Tx\", \"QZLuBCvXsGRQ9nCKHyXpfqkNjndT2KWU\") \n",
    "    httpProfile = HttpProfile()\n",
    "    httpProfile.endpoint = \"fmu.tencentcloudapi.com\"\n",
    "\n",
    "    clientProfile = ClientProfile()\n",
    "    clientProfile.httpProfile = httpProfile\n",
    "    client = fmu_client.FmuClient(cred, \"ap-guangzhou\", clientProfile) \n",
    "\n",
    "    req = models.TryLipstickPicRequest() # 功能选择--试唇色--TryLipstickPic\n",
    "    params = '{\\\"Url\\\":\\\"https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1594918415242&di=bba2ba9f382ec5cca5d223ff41426054&imgtype=0&src=http%3A%2F%2Fd.ifengimg.com%2Fw600%2Fp0.ifengimg.com%2Fpmop%2F2017%2F0811%2F98BDAF892B950293750DAAE328AF83EF0DB93B66_size257_w640_h530.png\\\",\\\n",
    "                \"LipColorInfos\\\":[{\\\n",
    "                                   \"RGBA\\\":{\\\n",
    "                                              \"R\\\":150,\\\n",
    "                                              \"G\\\":41,\\\n",
    "                                              \"B\\\":36,\\\n",
    "                                              \"A\\\":100},\\\n",
    "                                              \"ModelAlpha\\\":50}],\\\n",
    "                \"RspImgType\\\":\\\"url\\\"}'\n",
    "    # 输入照片链接（url）、颜色选择（LipColorInfos）、返回形式（RspImgType）\n",
    "   \n",
    "\n",
    "req.from_json_string(params)\n",
    "\n",
    "    resp = client.TryLipstickPic(req) \n",
    "    print(resp.to_json_string())\n",
    "\n",
    "except TencentCloudSDKException as err: \n",
    "    print(err)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 皮肤分析--美图皮肤分析API"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{\"parameter\": {\"rsp_media_type\": \"jpg\"}, \"extra\": {}, \"media_info_list\": [{\"media_data\": \"https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1594918415242&di=bba2ba9f382ec5cca5d223ff41426054&imgtype=0&src=http%3A%2F%2Fd.ifengimg.com%2Fw600%2Fp0.ifengimg.com%2Fpmop%2F2017%2F0811%2F98BDAF892B950293750DAAE328AF83EF0DB93B66_size257_w640_h530.png\", \"media_profiles\": {\"media_data_type\": \"url\"}, \"media_extra\": {}}]}\n",
      "{\"media_info_list\": [{\"media_extra\": {\"faces\": [{\"face_attributes\": {\"BlackHead_Area\": {\"value\": 0.0037664782721549273, \"confidence\": 0.99}, \"CheekRedValue\": {\"value\": 0, \"confidence\": 0.99}, \"CrowsFeed_LeftArea\": {\"value\": 0, \"confidence\": 0.99}, \"CrowsFeed_RightArea\": {\"value\": 0, \"confidence\": 0.99}, \"EyeWrinkle_LeftArea\": {\"value\": 0, \"confidence\": 0.99}, \"EyeWrinkle_RightArea\": {\"value\": 0, \"confidence\": 0.99}, \"NasolabialFolds_LeftArea\": {\"value\": 0.010450980626046658, \"confidence\": 0.99}, \"NasolabialFolds_RightArea\": {\"value\": 0, \"confidence\": 0.99}, \"PoresBetweenBrow_Have\": {\"value\": 0, \"confidence\": 0.99}, \"PoresCheeks_Left\": {\"value\": 0, \"confidence\": 0.99}, \"PoresCheeks_Right\": {\"value\": 0, \"confidence\": 0.99}, \"PoresForehead_Have\": {\"value\": 0, \"confidence\": 0.99}, \"SkinAcne\": {\"value\": 0, \"confidence\": 0.99}, \"SkinAge\": {\"value\": 25, \"confidence\": 0.99}, \"SkinBlackHeads\": {\"value\": 3, \"rectangle\": [{\"top\": 200, \"left\": 272, \"width\": 1, \"height\": 1.9999999}, {\"top\": 225, \"left\": 299, \"width\": 2, \"height\": 0.99999994}, {\"top\": 227, \"left\": 270, \"width\": 1, \"height\": 1.9999999}], \"confidence\": 0.99}, \"SkinColorHueDelta\": {\"value\": 2, \"confidence\": 0.99}, \"SkinColorLevel\": {\"value\": 3, \"confidence\": 0.99}, \"SkinCrowFeetLeftPathPoints\": {\"value\": [], \"confidence\": 0.99}, \"SkinCrowFeetRightPathPoints\": {\"value\": [], \"confidence\": 0.99}, \"SkinCrowsFeed_Left\": {\"value\": 0, \"confidence\": 0.99}, \"SkinCrowsFeed_Right\": {\"value\": 0, \"confidence\": 0.99}, \"SkinEyeFineLineScore_Left\": {\"value\": 0, \"confidence\": 0.99}, \"SkinEyeFineLineScore_Right\": {\"value\": 0, \"confidence\": 0.99}, \"SkinEyeFineLine_Left\": {\"value\": 0, \"confidence\": 0.99}, \"SkinEyeFineLine_Right\": {\"value\": 0, \"confidence\": 0.99}, \"SkinEyeWrinkleLeftPathPoints\": {\"value\": [], \"confidence\": 0.99}, \"SkinEyeWrinkleRightPathPoints\": {\"value\": [], \"confidence\": 0.99}, \"SkinEyeWrinkle_Left\": {\"value\": 0, \"confidence\": 0.99}, \"SkinEyeWrinkle_Right\": {\"value\": 0, \"confidence\": 0.99}, \"SkinForeHeadWrinkle\": {\"value\": 1, \"confidence\": 0.99}, \"SkinForeHeadWrinkleArea\": {\"value\": 0.0007254902157001197, \"confidence\": 0.99}, \"SkinForeheadWrinklePathPoints\": {\"value\": [[302, 95, 303, 95, 304, 95, 305, 95, 304, 95, 303, 95, 302, 95, 301, 95]], \"confidence\": 0.99}, \"SkinHighlight\": {\"value\": 0, \"confidence\": 0.99}, \"SkinHighlightPrec\": {\"value\": 0, \"confidence\": 0.99}, \"SkinLevel\": {\"value\": 34, \"confidence\": 0.99}, \"SkinMole\": {\"value\": 1, \"rectangle\": [{\"top\": 258.87366, \"left\": 347.68958, \"width\": 4.6326084, \"height\": 4.5779653}], \"confidence\": 0.99}, \"SkinNasolabialFoldLeftPathPoints\": {\"value\": [[233, 239, 232, 242, 232, 243, 232, 244, 232, 245, 232, 246, 232, 247, 232, 248, 232, 249, 232, 250, 232, 251, 231, 253, 230, 255, 231, 257, 233, 261, 233.99998, 262, 233.99998, 261, 233.99998, 260, 233.99998, 259, 233.99998, 258, 233.99998, 257, 233.99998, 256, 233.99998, 255, 233.99998, 254, 233.99998, 253, 233.99998, 247, 233.99998, 246, 233.99998, 245, 233.99998, 244, 233.99998, 243, 235.00002, 240, 235.00002, 239, 235.00002, 237, 235.00002, 236], [235.00002, 225, 237, 226, 237, 225, 237, 219, 237, 218, 237, 217], [235.00002, 210, 235.00002, 211]], \"confidence\": 0.99}, \"SkinNasolabialFoldRightPathPoints\": {\"value\": [], \"confidence\": 0.99}, \"SkinNasolabialFolds_Left\": {\"value\": 1, \"confidence\": 0.99}, \"SkinNasolabialFolds_Right\": {\"value\": 0, \"confidence\": 0.99}, \"SkinPandaEye_Left\": {\"value\": 1, \"confidence\": 0.99}, \"SkinPandaEye_Left_Artery\": {\"value\": 3, \"confidence\": 0.99}, \"SkinPandaEye_Left_Artery_Have\": {\"value\": 1, \"confidence\": 0.99}, \"SkinPandaEye_Left_Pigment\": {\"value\": 0, \"confidence\": 0.99}, \"SkinPandaEye_Left_Pigment_Have\": {\"value\": 0, \"confidence\": 0.99}, \"SkinPandaEye_Left_Shadow\": {\"value\": 1, \"confidence\": 0.99}, \"SkinPandaEye_Left_Shadow_Have\": {\"value\": 1, \"confidence\": 0.99}, \"SkinPandaEye_Right\": {\"value\": 1, \"confidence\": 0.99}, \"SkinPandaEye_Right_Artery\": {\"value\": 3, \"confidence\": 0.99}, \"SkinPandaEye_Right_Artery_Have\": {\"value\": 1, \"confidence\": 0.99}, \"SkinPandaEye_Right_Pigment\": {\"value\": 0, \"confidence\": 0.99}, \"SkinPandaEye_Right_Pigment_Have\": {\"value\": 0, \"confidence\": 0.99}, \"SkinPandaEye_Right_Shadow\": {\"value\": 1, \"confidence\": 0.99}, \"SkinPandaEye_Right_Shadow_Have\": {\"value\": 1, \"confidence\": 0.99}, \"SkinPimple\": {\"value\": 5, \"rectangle\": [{\"top\": 181.9916, \"left\": 328.16827, \"width\": 4.1309433, \"height\": 4.263444}, {\"top\": 301.12436, \"left\": 262.9377, \"width\": 3.963934, \"height\": 3.988798}, {\"top\": 241.89067, \"left\": 369.08936, \"width\": 1.8621166, \"height\": 1.9836379}, {\"top\": 42.541164, \"left\": 287.8228, \"width\": 4.2561407, \"height\": 4.5925784}, {\"top\": 230.64557, \"left\": 253.33707, \"width\": 6.3362494, \"height\": 6.125962}], \"confidence\": 0.99}, \"SkinRosaceaChin\": {\"value\": 1, \"confidence\": 0.99}, \"SkinRosaceaForehead\": {\"value\": 0, \"confidence\": 0.99}, \"SkinRosaceaLeftcheek\": {\"value\": 0, \"confidence\": 0.99}, \"SkinRosaceaNose\": {\"value\": 1, \"confidence\": 0.99}, \"SkinRosaceaRightcheek\": {\"value\": 0, \"confidence\": 0.99}, \"SkinSpot\": {\"value\": 20, \"rectangle\": [{\"top\": 213.10124, \"left\": 201.1225, \"width\": 2.5087502, \"height\": 2.8787498}, {\"top\": 129.6175, \"left\": 375.89874, \"width\": 2.23, \"height\": 2.4675}, {\"top\": 204.465, \"left\": 368.65125, \"width\": 2.7875001, \"height\": 2.8787498}, {\"top\": 221.73749, \"left\": 225.37376, \"width\": 3.0662503, \"height\": 3.7012498}, {\"top\": 65.87375, \"left\": 232.06375, \"width\": 3.0662503, \"height\": 3.2899997}, {\"top\": 129.20624, \"left\": 295.61877, \"width\": 3.0662503, \"height\": 3.2899997}, {\"top\": 229.55124, \"left\": 207.8125, \"width\": 1.9512501, \"height\": 2.4675}, {\"top\": 73.276245, \"left\": 237.91751, \"width\": 1.9512501, \"height\": 2.0562499}, {\"top\": 198.70749, \"left\": 368.93, \"width\": 2.23, \"height\": 2.0562499}, {\"top\": 181.02374, \"left\": 283.35376, \"width\": 2.23, \"height\": 2.0562499}, {\"top\": 220.50374, \"left\": 207.8125, \"width\": 2.23, \"height\": 2.4675}, {\"top\": 145.245, \"left\": 279.45126, \"width\": 3.0662503, \"height\": 3.2899997}, {\"top\": 191.71625, \"left\": 373.39005, \"width\": 1.9512501, \"height\": 2.0562499}, {\"top\": 311.38998, \"left\": 303.98126, \"width\": 1.9512501, \"height\": 2.0562499}, {\"top\": 75.3325, \"left\": 242.3775, \"width\": 2.7875001, \"height\": 2.4675}, {\"top\": 79.033745, \"left\": 276.385, \"width\": 3.3449998, \"height\": 3.2899997}, {\"top\": 209.4, \"left\": 320.985, \"width\": 3.3449998, \"height\": 3.2899997}, {\"top\": 249.29123, \"left\": 335.75876, \"width\": 3.6237502, \"height\": 4.1124997}, {\"top\": 198.70749, \"left\": 215.6175, \"width\": 1.9512501, \"height\": 1.6449999}, {\"top\": 86.43625, \"left\": 249.625, \"width\": 4.18125, \"height\": 4.1124997}], \"confidence\": 0.99}, \"SkinType\": {\"value\": 1, \"confidence\": 0.99}, \"TregionShinyRatio\": {\"value\": 0, \"confidence\": 0.99}}, \"face_rectangle\": {\"height\": 216.15465, \"left\": 175.45331, \"top\": 121.95089, \"width\": 209.97644}}]}}]}\n",
      "200\n"
     ]
    }
   ],
   "source": [
    "import requests\n",
    "import base64\n",
    "import json\n",
    "\n",
    "def algorhtmReq():\n",
    "#     image = open('./timg.jpeg', 'rb')\n",
    "#     image_64_encode = base64.encodestring(image_read).decode('utf-8')\n",
    "    ss = json.dumps(\n",
    "    {\n",
    "        \"parameter\": {\n",
    "            \"rsp_media_type\": \"jpg\",\n",
    "        },\n",
    "        \"extra\": {},\n",
    "        \"media_info_list\": [{\n",
    "            \"media_data\": 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1594918415242&di=bba2ba9f382ec5cca5d223ff41426054&imgtype=0&src=http%3A%2F%2Fd.ifengimg.com%2Fw600%2Fp0.ifengimg.com%2Fpmop%2F2017%2F0811%2F98BDAF892B950293750DAAE328AF83EF0DB93B66_size257_w640_h530.png',\n",
    "            \"media_profiles\": {\n",
    "                \"media_data_type\":\"url\"\n",
    "            },\n",
    "            \"media_extra\": {\n",
    "            }\n",
    "        }]\n",
    "\n",
    "    }\n",
    "    )\n",
    "# 输入照片链接（media_data）、以及选择输入照片类型（media_data_type）\n",
    "    \n",
    "    AIBeauty_url = \"https://openapi.mtlab.meitu.com/v2/skin?api_key=fyYRK0ndZ4PmiSKRm4n8EHcDyZkmrlI0&api_secret=Y_BCq_4viknHV5rogEZj_pbF0CgAp6Ux\"\n",
    "    print(ss)\n",
    "    response = requests.post(AIBeauty_url, data=ss)\n",
    "    ss2 = json.dumps(response.json())\n",
    "    print(ss2)\n",
    "    print(response.status_code)\n",
    "\n",
    "if __name__ == \"__main__\":\n",
    "    algorhtmReq()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 皮肤分析返回数据处理"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{\"parameter\": {\"rsp_media_type\": \"jpg\"}, \"extra\": {}, \"media_info_list\": [{\"media_data\": \"https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1594918415242&di=bba2ba9f382ec5cca5d223ff41426054&imgtype=0&src=http%3A%2F%2Fd.ifengimg.com%2Fw600%2Fp0.ifengimg.com%2Fpmop%2F2017%2F0811%2F98BDAF892B950293750DAAE328AF83EF0DB93B66_size257_w640_h530.png\", \"media_profiles\": {\"media_data_type\": \"url\"}, \"media_extra\": {}}]}\n",
      "{'media_info_list': [{'media_extra': {'faces': [{'face_attributes': {'BlackHead_Area': {'value': 0.0037664782721549273, 'confidence': 0.99}, 'CheekRedValue': {'value': 0, 'confidence': 0.99}, 'CrowsFeed_LeftArea': {'value': 0, 'confidence': 0.99}, 'CrowsFeed_RightArea': {'value': 0, 'confidence': 0.99}, 'EyeWrinkle_LeftArea': {'value': 0, 'confidence': 0.99}, 'EyeWrinkle_RightArea': {'value': 0, 'confidence': 0.99}, 'NasolabialFolds_LeftArea': {'value': 0.010450980626046658, 'confidence': 0.99}, 'NasolabialFolds_RightArea': {'value': 0, 'confidence': 0.99}, 'PoresBetweenBrow_Have': {'value': 0, 'confidence': 0.99}, 'PoresCheeks_Left': {'value': 0, 'confidence': 0.99}, 'PoresCheeks_Right': {'value': 0, 'confidence': 0.99}, 'PoresForehead_Have': {'value': 0, 'confidence': 0.99}, 'SkinAcne': {'value': 0, 'confidence': 0.99}, 'SkinAge': {'value': 25, 'confidence': 0.99}, 'SkinBlackHeads': {'value': 3, 'rectangle': [{'top': 200, 'left': 272, 'width': 1, 'height': 1.9999999}, {'top': 225, 'left': 299, 'width': 2, 'height': 0.99999994}, {'top': 227, 'left': 270, 'width': 1, 'height': 1.9999999}], 'confidence': 0.99}, 'SkinColorHueDelta': {'value': 2, 'confidence': 0.99}, 'SkinColorLevel': {'value': 3, 'confidence': 0.99}, 'SkinCrowFeetLeftPathPoints': {'value': [], 'confidence': 0.99}, 'SkinCrowFeetRightPathPoints': {'value': [], 'confidence': 0.99}, 'SkinCrowsFeed_Left': {'value': 0, 'confidence': 0.99}, 'SkinCrowsFeed_Right': {'value': 0, 'confidence': 0.99}, 'SkinEyeFineLineScore_Left': {'value': 0, 'confidence': 0.99}, 'SkinEyeFineLineScore_Right': {'value': 0, 'confidence': 0.99}, 'SkinEyeFineLine_Left': {'value': 0, 'confidence': 0.99}, 'SkinEyeFineLine_Right': {'value': 0, 'confidence': 0.99}, 'SkinEyeWrinkleLeftPathPoints': {'value': [], 'confidence': 0.99}, 'SkinEyeWrinkleRightPathPoints': {'value': [], 'confidence': 0.99}, 'SkinEyeWrinkle_Left': {'value': 0, 'confidence': 0.99}, 'SkinEyeWrinkle_Right': {'value': 0, 'confidence': 0.99}, 'SkinForeHeadWrinkle': {'value': 1, 'confidence': 0.99}, 'SkinForeHeadWrinkleArea': {'value': 0.0007254902157001197, 'confidence': 0.99}, 'SkinForeheadWrinklePathPoints': {'value': [[302, 95, 303, 95, 304, 95, 305, 95, 304, 95, 303, 95, 302, 95, 301, 95]], 'confidence': 0.99}, 'SkinHighlight': {'value': 0, 'confidence': 0.99}, 'SkinHighlightPrec': {'value': 0, 'confidence': 0.99}, 'SkinLevel': {'value': 34, 'confidence': 0.99}, 'SkinMole': {'value': 1, 'rectangle': [{'top': 258.87366, 'left': 347.68958, 'width': 4.6326084, 'height': 4.5779653}], 'confidence': 0.99}, 'SkinNasolabialFoldLeftPathPoints': {'value': [[233, 239, 232, 242, 232, 243, 232, 244, 232, 245, 232, 246, 232, 247, 232, 248, 232, 249, 232, 250, 232, 251, 231, 253, 230, 255, 231, 257, 233, 261, 233.99998, 262, 233.99998, 261, 233.99998, 260, 233.99998, 259, 233.99998, 258, 233.99998, 257, 233.99998, 256, 233.99998, 255, 233.99998, 254, 233.99998, 253, 233.99998, 247, 233.99998, 246, 233.99998, 245, 233.99998, 244, 233.99998, 243, 235.00002, 240, 235.00002, 239, 235.00002, 237, 235.00002, 236], [235.00002, 225, 237, 226, 237, 225, 237, 219, 237, 218, 237, 217], [235.00002, 210, 235.00002, 211]], 'confidence': 0.99}, 'SkinNasolabialFoldRightPathPoints': {'value': [], 'confidence': 0.99}, 'SkinNasolabialFolds_Left': {'value': 1, 'confidence': 0.99}, 'SkinNasolabialFolds_Right': {'value': 0, 'confidence': 0.99}, 'SkinPandaEye_Left': {'value': 1, 'confidence': 0.99}, 'SkinPandaEye_Left_Artery': {'value': 3, 'confidence': 0.99}, 'SkinPandaEye_Left_Artery_Have': {'value': 1, 'confidence': 0.99}, 'SkinPandaEye_Left_Pigment': {'value': 0, 'confidence': 0.99}, 'SkinPandaEye_Left_Pigment_Have': {'value': 0, 'confidence': 0.99}, 'SkinPandaEye_Left_Shadow': {'value': 1, 'confidence': 0.99}, 'SkinPandaEye_Left_Shadow_Have': {'value': 1, 'confidence': 0.99}, 'SkinPandaEye_Right': {'value': 1, 'confidence': 0.99}, 'SkinPandaEye_Right_Artery': {'value': 3, 'confidence': 0.99}, 'SkinPandaEye_Right_Artery_Have': {'value': 1, 'confidence': 0.99}, 'SkinPandaEye_Right_Pigment': {'value': 0, 'confidence': 0.99}, 'SkinPandaEye_Right_Pigment_Have': {'value': 0, 'confidence': 0.99}, 'SkinPandaEye_Right_Shadow': {'value': 1, 'confidence': 0.99}, 'SkinPandaEye_Right_Shadow_Have': {'value': 1, 'confidence': 0.99}, 'SkinPimple': {'value': 5, 'rectangle': [{'top': 181.9916, 'left': 328.16827, 'width': 4.1309433, 'height': 4.263444}, {'top': 301.12436, 'left': 262.9377, 'width': 3.963934, 'height': 3.988798}, {'top': 241.89067, 'left': 369.08936, 'width': 1.8621166, 'height': 1.9836379}, {'top': 42.541164, 'left': 287.8228, 'width': 4.2561407, 'height': 4.5925784}, {'top': 230.64557, 'left': 253.33707, 'width': 6.3362494, 'height': 6.125962}], 'confidence': 0.99}, 'SkinRosaceaChin': {'value': 1, 'confidence': 0.99}, 'SkinRosaceaForehead': {'value': 0, 'confidence': 0.99}, 'SkinRosaceaLeftcheek': {'value': 0, 'confidence': 0.99}, 'SkinRosaceaNose': {'value': 1, 'confidence': 0.99}, 'SkinRosaceaRightcheek': {'value': 0, 'confidence': 0.99}, 'SkinSpot': {'value': 20, 'rectangle': [{'top': 213.10124, 'left': 201.1225, 'width': 2.5087502, 'height': 2.8787498}, {'top': 129.6175, 'left': 375.89874, 'width': 2.23, 'height': 2.4675}, {'top': 204.465, 'left': 368.65125, 'width': 2.7875001, 'height': 2.8787498}, {'top': 221.73749, 'left': 225.37376, 'width': 3.0662503, 'height': 3.7012498}, {'top': 65.87375, 'left': 232.06375, 'width': 3.0662503, 'height': 3.2899997}, {'top': 129.20624, 'left': 295.61877, 'width': 3.0662503, 'height': 3.2899997}, {'top': 229.55124, 'left': 207.8125, 'width': 1.9512501, 'height': 2.4675}, {'top': 73.276245, 'left': 237.91751, 'width': 1.9512501, 'height': 2.0562499}, {'top': 198.70749, 'left': 368.93, 'width': 2.23, 'height': 2.0562499}, {'top': 181.02374, 'left': 283.35376, 'width': 2.23, 'height': 2.0562499}, {'top': 220.50374, 'left': 207.8125, 'width': 2.23, 'height': 2.4675}, {'top': 145.245, 'left': 279.45126, 'width': 3.0662503, 'height': 3.2899997}, {'top': 191.71625, 'left': 373.39005, 'width': 1.9512501, 'height': 2.0562499}, {'top': 311.38998, 'left': 303.98126, 'width': 1.9512501, 'height': 2.0562499}, {'top': 75.3325, 'left': 242.3775, 'width': 2.7875001, 'height': 2.4675}, {'top': 79.033745, 'left': 276.385, 'width': 3.3449998, 'height': 3.2899997}, {'top': 209.4, 'left': 320.985, 'width': 3.3449998, 'height': 3.2899997}, {'top': 249.29123, 'left': 335.75876, 'width': 3.6237502, 'height': 4.1124997}, {'top': 198.70749, 'left': 215.6175, 'width': 1.9512501, 'height': 1.6449999}, {'top': 86.43625, 'left': 249.625, 'width': 4.18125, 'height': 4.1124997}], 'confidence': 0.99}, 'SkinType': {'value': 1, 'confidence': 0.99}, 'TregionShinyRatio': {'value': 0, 'confidence': 0.99}}, 'face_rectangle': {'height': 216.15465, 'left': 175.45331, 'top': 121.95089, 'width': 209.97644}}]}}]}\n",
      "200\n"
     ]
    }
   ],
   "source": [
    "ss = json.dumps(\n",
    "    {\n",
    "        \"parameter\": {\n",
    "            \"rsp_media_type\": \"jpg\",\n",
    "        },\n",
    "        \"extra\": {},\n",
    "        \"media_info_list\": [{\n",
    "            \"media_data\": 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1594918415242&di=bba2ba9f382ec5cca5d223ff41426054&imgtype=0&src=http%3A%2F%2Fd.ifengimg.com%2Fw600%2Fp0.ifengimg.com%2Fpmop%2F2017%2F0811%2F98BDAF892B950293750DAAE328AF83EF0DB93B66_size257_w640_h530.png',\n",
    "            \"media_profiles\": {\n",
    "                \"media_data_type\":\"url\"\n",
    "            },\n",
    "            \"media_extra\": {\n",
    "            }\n",
    "        }]\n",
    "\n",
    "    }\n",
    "    )\n",
    "AIBeauty_url = \"https://openapi.mtlab.meitu.com/v2/skin?api_key=fyYRK0ndZ4PmiSKRm4n8EHcDyZkmrlI0&api_secret=Y_BCq_4viknHV5rogEZj_pbF0CgAp6Ux\"\n",
    "print(ss)\n",
    "response = requests.post(AIBeauty_url, data=ss)\n",
    "ss2 = response.json()\n",
    "print(ss2)\n",
    "print(response.status_code)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'media_info_list': [{'media_extra': {'faces': [{'face_attributes': {'BlackHead_Area': {'value': 0.0037664782721549273,\n",
       "        'confidence': 0.99},\n",
       "       'CheekRedValue': {'value': 0, 'confidence': 0.99},\n",
       "       'CrowsFeed_LeftArea': {'value': 0, 'confidence': 0.99},\n",
       "       'CrowsFeed_RightArea': {'value': 0, 'confidence': 0.99},\n",
       "       'EyeWrinkle_LeftArea': {'value': 0, 'confidence': 0.99},\n",
       "       'EyeWrinkle_RightArea': {'value': 0, 'confidence': 0.99},\n",
       "       'NasolabialFolds_LeftArea': {'value': 0.010450980626046658,\n",
       "        'confidence': 0.99},\n",
       "       'NasolabialFolds_RightArea': {'value': 0, 'confidence': 0.99},\n",
       "       'PoresBetweenBrow_Have': {'value': 0, 'confidence': 0.99},\n",
       "       'PoresCheeks_Left': {'value': 0, 'confidence': 0.99},\n",
       "       'PoresCheeks_Right': {'value': 0, 'confidence': 0.99},\n",
       "       'PoresForehead_Have': {'value': 0, 'confidence': 0.99},\n",
       "       'SkinAcne': {'value': 0, 'confidence': 0.99},\n",
       "       'SkinAge': {'value': 25, 'confidence': 0.99},\n",
       "       'SkinBlackHeads': {'value': 3,\n",
       "        'rectangle': [{'top': 200,\n",
       "          'left': 272,\n",
       "          'width': 1,\n",
       "          'height': 1.9999999},\n",
       "         {'top': 225, 'left': 299, 'width': 2, 'height': 0.99999994},\n",
       "         {'top': 227, 'left': 270, 'width': 1, 'height': 1.9999999}],\n",
       "        'confidence': 0.99},\n",
       "       'SkinColorHueDelta': {'value': 2, 'confidence': 0.99},\n",
       "       'SkinColorLevel': {'value': 3, 'confidence': 0.99},\n",
       "       'SkinCrowFeetLeftPathPoints': {'value': [], 'confidence': 0.99},\n",
       "       'SkinCrowFeetRightPathPoints': {'value': [], 'confidence': 0.99},\n",
       "       'SkinCrowsFeed_Left': {'value': 0, 'confidence': 0.99},\n",
       "       'SkinCrowsFeed_Right': {'value': 0, 'confidence': 0.99},\n",
       "       'SkinEyeFineLineScore_Left': {'value': 0, 'confidence': 0.99},\n",
       "       'SkinEyeFineLineScore_Right': {'value': 0, 'confidence': 0.99},\n",
       "       'SkinEyeFineLine_Left': {'value': 0, 'confidence': 0.99},\n",
       "       'SkinEyeFineLine_Right': {'value': 0, 'confidence': 0.99},\n",
       "       'SkinEyeWrinkleLeftPathPoints': {'value': [], 'confidence': 0.99},\n",
       "       'SkinEyeWrinkleRightPathPoints': {'value': [], 'confidence': 0.99},\n",
       "       'SkinEyeWrinkle_Left': {'value': 0, 'confidence': 0.99},\n",
       "       'SkinEyeWrinkle_Right': {'value': 0, 'confidence': 0.99},\n",
       "       'SkinForeHeadWrinkle': {'value': 1, 'confidence': 0.99},\n",
       "       'SkinForeHeadWrinkleArea': {'value': 0.0007254902157001197,\n",
       "        'confidence': 0.99},\n",
       "       'SkinForeheadWrinklePathPoints': {'value': [[302,\n",
       "          95,\n",
       "          303,\n",
       "          95,\n",
       "          304,\n",
       "          95,\n",
       "          305,\n",
       "          95,\n",
       "          304,\n",
       "          95,\n",
       "          303,\n",
       "          95,\n",
       "          302,\n",
       "          95,\n",
       "          301,\n",
       "          95]],\n",
       "        'confidence': 0.99},\n",
       "       'SkinHighlight': {'value': 0, 'confidence': 0.99},\n",
       "       'SkinHighlightPrec': {'value': 0, 'confidence': 0.99},\n",
       "       'SkinLevel': {'value': 34, 'confidence': 0.99},\n",
       "       'SkinMole': {'value': 1,\n",
       "        'rectangle': [{'top': 258.87366,\n",
       "          'left': 347.68958,\n",
       "          'width': 4.6326084,\n",
       "          'height': 4.5779653}],\n",
       "        'confidence': 0.99},\n",
       "       'SkinNasolabialFoldLeftPathPoints': {'value': [[233,\n",
       "          239,\n",
       "          232,\n",
       "          242,\n",
       "          232,\n",
       "          243,\n",
       "          232,\n",
       "          244,\n",
       "          232,\n",
       "          245,\n",
       "          232,\n",
       "          246,\n",
       "          232,\n",
       "          247,\n",
       "          232,\n",
       "          248,\n",
       "          232,\n",
       "          249,\n",
       "          232,\n",
       "          250,\n",
       "          232,\n",
       "          251,\n",
       "          231,\n",
       "          253,\n",
       "          230,\n",
       "          255,\n",
       "          231,\n",
       "          257,\n",
       "          233,\n",
       "          261,\n",
       "          233.99998,\n",
       "          262,\n",
       "          233.99998,\n",
       "          261,\n",
       "          233.99998,\n",
       "          260,\n",
       "          233.99998,\n",
       "          259,\n",
       "          233.99998,\n",
       "          258,\n",
       "          233.99998,\n",
       "          257,\n",
       "          233.99998,\n",
       "          256,\n",
       "          233.99998,\n",
       "          255,\n",
       "          233.99998,\n",
       "          254,\n",
       "          233.99998,\n",
       "          253,\n",
       "          233.99998,\n",
       "          247,\n",
       "          233.99998,\n",
       "          246,\n",
       "          233.99998,\n",
       "          245,\n",
       "          233.99998,\n",
       "          244,\n",
       "          233.99998,\n",
       "          243,\n",
       "          235.00002,\n",
       "          240,\n",
       "          235.00002,\n",
       "          239,\n",
       "          235.00002,\n",
       "          237,\n",
       "          235.00002,\n",
       "          236],\n",
       "         [235.00002, 225, 237, 226, 237, 225, 237, 219, 237, 218, 237, 217],\n",
       "         [235.00002, 210, 235.00002, 211]],\n",
       "        'confidence': 0.99},\n",
       "       'SkinNasolabialFoldRightPathPoints': {'value': [], 'confidence': 0.99},\n",
       "       'SkinNasolabialFolds_Left': {'value': 1, 'confidence': 0.99},\n",
       "       'SkinNasolabialFolds_Right': {'value': 0, 'confidence': 0.99},\n",
       "       'SkinPandaEye_Left': {'value': 1, 'confidence': 0.99},\n",
       "       'SkinPandaEye_Left_Artery': {'value': 3, 'confidence': 0.99},\n",
       "       'SkinPandaEye_Left_Artery_Have': {'value': 1, 'confidence': 0.99},\n",
       "       'SkinPandaEye_Left_Pigment': {'value': 0, 'confidence': 0.99},\n",
       "       'SkinPandaEye_Left_Pigment_Have': {'value': 0, 'confidence': 0.99},\n",
       "       'SkinPandaEye_Left_Shadow': {'value': 1, 'confidence': 0.99},\n",
       "       'SkinPandaEye_Left_Shadow_Have': {'value': 1, 'confidence': 0.99},\n",
       "       'SkinPandaEye_Right': {'value': 1, 'confidence': 0.99},\n",
       "       'SkinPandaEye_Right_Artery': {'value': 3, 'confidence': 0.99},\n",
       "       'SkinPandaEye_Right_Artery_Have': {'value': 1, 'confidence': 0.99},\n",
       "       'SkinPandaEye_Right_Pigment': {'value': 0, 'confidence': 0.99},\n",
       "       'SkinPandaEye_Right_Pigment_Have': {'value': 0, 'confidence': 0.99},\n",
       "       'SkinPandaEye_Right_Shadow': {'value': 1, 'confidence': 0.99},\n",
       "       'SkinPandaEye_Right_Shadow_Have': {'value': 1, 'confidence': 0.99},\n",
       "       'SkinPimple': {'value': 5,\n",
       "        'rectangle': [{'top': 181.9916,\n",
       "          'left': 328.16827,\n",
       "          'width': 4.1309433,\n",
       "          'height': 4.263444},\n",
       "         {'top': 301.12436,\n",
       "          'left': 262.9377,\n",
       "          'width': 3.963934,\n",
       "          'height': 3.988798},\n",
       "         {'top': 241.89067,\n",
       "          'left': 369.08936,\n",
       "          'width': 1.8621166,\n",
       "          'height': 1.9836379},\n",
       "         {'top': 42.541164,\n",
       "          'left': 287.8228,\n",
       "          'width': 4.2561407,\n",
       "          'height': 4.5925784},\n",
       "         {'top': 230.64557,\n",
       "          'left': 253.33707,\n",
       "          'width': 6.3362494,\n",
       "          'height': 6.125962}],\n",
       "        'confidence': 0.99},\n",
       "       'SkinRosaceaChin': {'value': 1, 'confidence': 0.99},\n",
       "       'SkinRosaceaForehead': {'value': 0, 'confidence': 0.99},\n",
       "       'SkinRosaceaLeftcheek': {'value': 0, 'confidence': 0.99},\n",
       "       'SkinRosaceaNose': {'value': 1, 'confidence': 0.99},\n",
       "       'SkinRosaceaRightcheek': {'value': 0, 'confidence': 0.99},\n",
       "       'SkinSpot': {'value': 20,\n",
       "        'rectangle': [{'top': 213.10124,\n",
       "          'left': 201.1225,\n",
       "          'width': 2.5087502,\n",
       "          'height': 2.8787498},\n",
       "         {'top': 129.6175, 'left': 375.89874, 'width': 2.23, 'height': 2.4675},\n",
       "         {'top': 204.465,\n",
       "          'left': 368.65125,\n",
       "          'width': 2.7875001,\n",
       "          'height': 2.8787498},\n",
       "         {'top': 221.73749,\n",
       "          'left': 225.37376,\n",
       "          'width': 3.0662503,\n",
       "          'height': 3.7012498},\n",
       "         {'top': 65.87375,\n",
       "          'left': 232.06375,\n",
       "          'width': 3.0662503,\n",
       "          'height': 3.2899997},\n",
       "         {'top': 129.20624,\n",
       "          'left': 295.61877,\n",
       "          'width': 3.0662503,\n",
       "          'height': 3.2899997},\n",
       "         {'top': 229.55124,\n",
       "          'left': 207.8125,\n",
       "          'width': 1.9512501,\n",
       "          'height': 2.4675},\n",
       "         {'top': 73.276245,\n",
       "          'left': 237.91751,\n",
       "          'width': 1.9512501,\n",
       "          'height': 2.0562499},\n",
       "         {'top': 198.70749,\n",
       "          'left': 368.93,\n",
       "          'width': 2.23,\n",
       "          'height': 2.0562499},\n",
       "         {'top': 181.02374,\n",
       "          'left': 283.35376,\n",
       "          'width': 2.23,\n",
       "          'height': 2.0562499},\n",
       "         {'top': 220.50374, 'left': 207.8125, 'width': 2.23, 'height': 2.4675},\n",
       "         {'top': 145.245,\n",
       "          'left': 279.45126,\n",
       "          'width': 3.0662503,\n",
       "          'height': 3.2899997},\n",
       "         {'top': 191.71625,\n",
       "          'left': 373.39005,\n",
       "          'width': 1.9512501,\n",
       "          'height': 2.0562499},\n",
       "         {'top': 311.38998,\n",
       "          'left': 303.98126,\n",
       "          'width': 1.9512501,\n",
       "          'height': 2.0562499},\n",
       "         {'top': 75.3325,\n",
       "          'left': 242.3775,\n",
       "          'width': 2.7875001,\n",
       "          'height': 2.4675},\n",
       "         {'top': 79.033745,\n",
       "          'left': 276.385,\n",
       "          'width': 3.3449998,\n",
       "          'height': 3.2899997},\n",
       "         {'top': 209.4,\n",
       "          'left': 320.985,\n",
       "          'width': 3.3449998,\n",
       "          'height': 3.2899997},\n",
       "         {'top': 249.29123,\n",
       "          'left': 335.75876,\n",
       "          'width': 3.6237502,\n",
       "          'height': 4.1124997},\n",
       "         {'top': 198.70749,\n",
       "          'left': 215.6175,\n",
       "          'width': 1.9512501,\n",
       "          'height': 1.6449999},\n",
       "         {'top': 86.43625,\n",
       "          'left': 249.625,\n",
       "          'width': 4.18125,\n",
       "          'height': 4.1124997}],\n",
       "        'confidence': 0.99},\n",
       "       'SkinType': {'value': 1, 'confidence': 0.99},\n",
       "       'TregionShinyRatio': {'value': 0, 'confidence': 0.99}},\n",
       "      'face_rectangle': {'height': 216.15465,\n",
       "       'left': 175.45331,\n",
       "       'top': 121.95089,\n",
       "       'width': 209.97644}}]}}]}"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ss2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "ss3 = ss2['media_info_list']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'media_extra': {'faces': [{'face_attributes': {'BlackHead_Area': {'value': 0.0037664782721549273, 'confidence': 0.99}, 'CheekRedValue': {'value': 0, 'confidence': 0.99}, 'CrowsFeed_LeftArea': {'value': 0, 'confidence': 0.99}, 'CrowsFeed_RightArea': {'value': 0, 'confidence': 0.99}, 'EyeWrinkle_LeftArea': {'value': 0, 'confidence': 0.99}, 'EyeWrinkle_RightArea': {'value': 0, 'confidence': 0.99}, 'NasolabialFolds_LeftArea': {'value': 0.010450980626046658, 'confidence': 0.99}, 'NasolabialFolds_RightArea': {'value': 0, 'confidence': 0.99}, 'PoresBetweenBrow_Have': {'value': 0, 'confidence': 0.99}, 'PoresCheeks_Left': {'value': 0, 'confidence': 0.99}, 'PoresCheeks_Right': {'value': 0, 'confidence': 0.99}, 'PoresForehead_Have': {'value': 0, 'confidence': 0.99}, 'SkinAcne': {'value': 0, 'confidence': 0.99}, 'SkinAge': {'value': 25, 'confidence': 0.99}, 'SkinBlackHeads': {'value': 3, 'rectangle': [{'top': 200, 'left': 272, 'width': 1, 'height': 1.9999999}, {'top': 225, 'left': 299, 'width': 2, 'height': 0.99999994}, {'top': 227, 'left': 270, 'width': 1, 'height': 1.9999999}], 'confidence': 0.99}, 'SkinColorHueDelta': {'value': 2, 'confidence': 0.99}, 'SkinColorLevel': {'value': 3, 'confidence': 0.99}, 'SkinCrowFeetLeftPathPoints': {'value': [], 'confidence': 0.99}, 'SkinCrowFeetRightPathPoints': {'value': [], 'confidence': 0.99}, 'SkinCrowsFeed_Left': {'value': 0, 'confidence': 0.99}, 'SkinCrowsFeed_Right': {'value': 0, 'confidence': 0.99}, 'SkinEyeFineLineScore_Left': {'value': 0, 'confidence': 0.99}, 'SkinEyeFineLineScore_Right': {'value': 0, 'confidence': 0.99}, 'SkinEyeFineLine_Left': {'value': 0, 'confidence': 0.99}, 'SkinEyeFineLine_Right': {'value': 0, 'confidence': 0.99}, 'SkinEyeWrinkleLeftPathPoints': {'value': [], 'confidence': 0.99}, 'SkinEyeWrinkleRightPathPoints': {'value': [], 'confidence': 0.99}, 'SkinEyeWrinkle_Left': {'value': 0, 'confidence': 0.99}, 'SkinEyeWrinkle_Right': {'value': 0, 'confidence': 0.99}, 'SkinForeHeadWrinkle': {'value': 1, 'confidence': 0.99}, 'SkinForeHeadWrinkleArea': {'value': 0.0007254902157001197, 'confidence': 0.99}, 'SkinForeheadWrinklePathPoints': {'value': [[302, 95, 303, 95, 304, 95, 305, 95, 304, 95, 303, 95, 302, 95, 301, 95]], 'confidence': 0.99}, 'SkinHighlight': {'value': 0, 'confidence': 0.99}, 'SkinHighlightPrec': {'value': 0, 'confidence': 0.99}, 'SkinLevel': {'value': 34, 'confidence': 0.99}, 'SkinMole': {'value': 1, 'rectangle': [{'top': 258.87366, 'left': 347.68958, 'width': 4.6326084, 'height': 4.5779653}], 'confidence': 0.99}, 'SkinNasolabialFoldLeftPathPoints': {'value': [[233, 239, 232, 242, 232, 243, 232, 244, 232, 245, 232, 246, 232, 247, 232, 248, 232, 249, 232, 250, 232, 251, 231, 253, 230, 255, 231, 257, 233, 261, 233.99998, 262, 233.99998, 261, 233.99998, 260, 233.99998, 259, 233.99998, 258, 233.99998, 257, 233.99998, 256, 233.99998, 255, 233.99998, 254, 233.99998, 253, 233.99998, 247, 233.99998, 246, 233.99998, 245, 233.99998, 244, 233.99998, 243, 235.00002, 240, 235.00002, 239, 235.00002, 237, 235.00002, 236], [235.00002, 225, 237, 226, 237, 225, 237, 219, 237, 218, 237, 217], [235.00002, 210, 235.00002, 211]], 'confidence': 0.99}, 'SkinNasolabialFoldRightPathPoints': {'value': [], 'confidence': 0.99}, 'SkinNasolabialFolds_Left': {'value': 1, 'confidence': 0.99}, 'SkinNasolabialFolds_Right': {'value': 0, 'confidence': 0.99}, 'SkinPandaEye_Left': {'value': 1, 'confidence': 0.99}, 'SkinPandaEye_Left_Artery': {'value': 3, 'confidence': 0.99}, 'SkinPandaEye_Left_Artery_Have': {'value': 1, 'confidence': 0.99}, 'SkinPandaEye_Left_Pigment': {'value': 0, 'confidence': 0.99}, 'SkinPandaEye_Left_Pigment_Have': {'value': 0, 'confidence': 0.99}, 'SkinPandaEye_Left_Shadow': {'value': 1, 'confidence': 0.99}, 'SkinPandaEye_Left_Shadow_Have': {'value': 1, 'confidence': 0.99}, 'SkinPandaEye_Right': {'value': 1, 'confidence': 0.99}, 'SkinPandaEye_Right_Artery': {'value': 3, 'confidence': 0.99}, 'SkinPandaEye_Right_Artery_Have': {'value': 1, 'confidence': 0.99}, 'SkinPandaEye_Right_Pigment': {'value': 0, 'confidence': 0.99}, 'SkinPandaEye_Right_Pigment_Have': {'value': 0, 'confidence': 0.99}, 'SkinPandaEye_Right_Shadow': {'value': 1, 'confidence': 0.99}, 'SkinPandaEye_Right_Shadow_Have': {'value': 1, 'confidence': 0.99}, 'SkinPimple': {'value': 5, 'rectangle': [{'top': 181.9916, 'left': 328.16827, 'width': 4.1309433, 'height': 4.263444}, {'top': 301.12436, 'left': 262.9377, 'width': 3.963934, 'height': 3.988798}, {'top': 241.89067, 'left': 369.08936, 'width': 1.8621166, 'height': 1.9836379}, {'top': 42.541164, 'left': 287.8228, 'width': 4.2561407, 'height': 4.5925784}, {'top': 230.64557, 'left': 253.33707, 'width': 6.3362494, 'height': 6.125962}], 'confidence': 0.99}, 'SkinRosaceaChin': {'value': 1, 'confidence': 0.99}, 'SkinRosaceaForehead': {'value': 0, 'confidence': 0.99}, 'SkinRosaceaLeftcheek': {'value': 0, 'confidence': 0.99}, 'SkinRosaceaNose': {'value': 1, 'confidence': 0.99}, 'SkinRosaceaRightcheek': {'value': 0, 'confidence': 0.99}, 'SkinSpot': {'value': 20, 'rectangle': [{'top': 213.10124, 'left': 201.1225, 'width': 2.5087502, 'height': 2.8787498}, {'top': 129.6175, 'left': 375.89874, 'width': 2.23, 'height': 2.4675}, {'top': 204.465, 'left': 368.65125, 'width': 2.7875001, 'height': 2.8787498}, {'top': 221.73749, 'left': 225.37376, 'width': 3.0662503, 'height': 3.7012498}, {'top': 65.87375, 'left': 232.06375, 'width': 3.0662503, 'height': 3.2899997}, {'top': 129.20624, 'left': 295.61877, 'width': 3.0662503, 'height': 3.2899997}, {'top': 229.55124, 'left': 207.8125, 'width': 1.9512501, 'height': 2.4675}, {'top': 73.276245, 'left': 237.91751, 'width': 1.9512501, 'height': 2.0562499}, {'top': 198.70749, 'left': 368.93, 'width': 2.23, 'height': 2.0562499}, {'top': 181.02374, 'left': 283.35376, 'width': 2.23, 'height': 2.0562499}, {'top': 220.50374, 'left': 207.8125, 'width': 2.23, 'height': 2.4675}, {'top': 145.245, 'left': 279.45126, 'width': 3.0662503, 'height': 3.2899997}, {'top': 191.71625, 'left': 373.39005, 'width': 1.9512501, 'height': 2.0562499}, {'top': 311.38998, 'left': 303.98126, 'width': 1.9512501, 'height': 2.0562499}, {'top': 75.3325, 'left': 242.3775, 'width': 2.7875001, 'height': 2.4675}, {'top': 79.033745, 'left': 276.385, 'width': 3.3449998, 'height': 3.2899997}, {'top': 209.4, 'left': 320.985, 'width': 3.3449998, 'height': 3.2899997}, {'top': 249.29123, 'left': 335.75876, 'width': 3.6237502, 'height': 4.1124997}, {'top': 198.70749, 'left': 215.6175, 'width': 1.9512501, 'height': 1.6449999}, {'top': 86.43625, 'left': 249.625, 'width': 4.18125, 'height': 4.1124997}], 'confidence': 0.99}, 'SkinType': {'value': 1, 'confidence': 0.99}, 'TregionShinyRatio': {'value': 0, 'confidence': 0.99}}, 'face_rectangle': {'height': 216.15465, 'left': 175.45331, 'top': 121.95089, 'width': 209.97644}}]}}\n"
     ]
    }
   ],
   "source": [
    "for i in ss3:\n",
    "    print(i)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'faces': [{'face_attributes': {'BlackHead_Area': {'value': 0.0037664782721549273,\n",
       "     'confidence': 0.99},\n",
       "    'CheekRedValue': {'value': 0, 'confidence': 0.99},\n",
       "    'CrowsFeed_LeftArea': {'value': 0, 'confidence': 0.99},\n",
       "    'CrowsFeed_RightArea': {'value': 0, 'confidence': 0.99},\n",
       "    'EyeWrinkle_LeftArea': {'value': 0, 'confidence': 0.99},\n",
       "    'EyeWrinkle_RightArea': {'value': 0, 'confidence': 0.99},\n",
       "    'NasolabialFolds_LeftArea': {'value': 0.010450980626046658,\n",
       "     'confidence': 0.99},\n",
       "    'NasolabialFolds_RightArea': {'value': 0, 'confidence': 0.99},\n",
       "    'PoresBetweenBrow_Have': {'value': 0, 'confidence': 0.99},\n",
       "    'PoresCheeks_Left': {'value': 0, 'confidence': 0.99},\n",
       "    'PoresCheeks_Right': {'value': 0, 'confidence': 0.99},\n",
       "    'PoresForehead_Have': {'value': 0, 'confidence': 0.99},\n",
       "    'SkinAcne': {'value': 0, 'confidence': 0.99},\n",
       "    'SkinAge': {'value': 25, 'confidence': 0.99},\n",
       "    'SkinBlackHeads': {'value': 3,\n",
       "     'rectangle': [{'top': 200, 'left': 272, 'width': 1, 'height': 1.9999999},\n",
       "      {'top': 225, 'left': 299, 'width': 2, 'height': 0.99999994},\n",
       "      {'top': 227, 'left': 270, 'width': 1, 'height': 1.9999999}],\n",
       "     'confidence': 0.99},\n",
       "    'SkinColorHueDelta': {'value': 2, 'confidence': 0.99},\n",
       "    'SkinColorLevel': {'value': 3, 'confidence': 0.99},\n",
       "    'SkinCrowFeetLeftPathPoints': {'value': [], 'confidence': 0.99},\n",
       "    'SkinCrowFeetRightPathPoints': {'value': [], 'confidence': 0.99},\n",
       "    'SkinCrowsFeed_Left': {'value': 0, 'confidence': 0.99},\n",
       "    'SkinCrowsFeed_Right': {'value': 0, 'confidence': 0.99},\n",
       "    'SkinEyeFineLineScore_Left': {'value': 0, 'confidence': 0.99},\n",
       "    'SkinEyeFineLineScore_Right': {'value': 0, 'confidence': 0.99},\n",
       "    'SkinEyeFineLine_Left': {'value': 0, 'confidence': 0.99},\n",
       "    'SkinEyeFineLine_Right': {'value': 0, 'confidence': 0.99},\n",
       "    'SkinEyeWrinkleLeftPathPoints': {'value': [], 'confidence': 0.99},\n",
       "    'SkinEyeWrinkleRightPathPoints': {'value': [], 'confidence': 0.99},\n",
       "    'SkinEyeWrinkle_Left': {'value': 0, 'confidence': 0.99},\n",
       "    'SkinEyeWrinkle_Right': {'value': 0, 'confidence': 0.99},\n",
       "    'SkinForeHeadWrinkle': {'value': 1, 'confidence': 0.99},\n",
       "    'SkinForeHeadWrinkleArea': {'value': 0.0007254902157001197,\n",
       "     'confidence': 0.99},\n",
       "    'SkinForeheadWrinklePathPoints': {'value': [[302,\n",
       "       95,\n",
       "       303,\n",
       "       95,\n",
       "       304,\n",
       "       95,\n",
       "       305,\n",
       "       95,\n",
       "       304,\n",
       "       95,\n",
       "       303,\n",
       "       95,\n",
       "       302,\n",
       "       95,\n",
       "       301,\n",
       "       95]],\n",
       "     'confidence': 0.99},\n",
       "    'SkinHighlight': {'value': 0, 'confidence': 0.99},\n",
       "    'SkinHighlightPrec': {'value': 0, 'confidence': 0.99},\n",
       "    'SkinLevel': {'value': 34, 'confidence': 0.99},\n",
       "    'SkinMole': {'value': 1,\n",
       "     'rectangle': [{'top': 258.87366,\n",
       "       'left': 347.68958,\n",
       "       'width': 4.6326084,\n",
       "       'height': 4.5779653}],\n",
       "     'confidence': 0.99},\n",
       "    'SkinNasolabialFoldLeftPathPoints': {'value': [[233,\n",
       "       239,\n",
       "       232,\n",
       "       242,\n",
       "       232,\n",
       "       243,\n",
       "       232,\n",
       "       244,\n",
       "       232,\n",
       "       245,\n",
       "       232,\n",
       "       246,\n",
       "       232,\n",
       "       247,\n",
       "       232,\n",
       "       248,\n",
       "       232,\n",
       "       249,\n",
       "       232,\n",
       "       250,\n",
       "       232,\n",
       "       251,\n",
       "       231,\n",
       "       253,\n",
       "       230,\n",
       "       255,\n",
       "       231,\n",
       "       257,\n",
       "       233,\n",
       "       261,\n",
       "       233.99998,\n",
       "       262,\n",
       "       233.99998,\n",
       "       261,\n",
       "       233.99998,\n",
       "       260,\n",
       "       233.99998,\n",
       "       259,\n",
       "       233.99998,\n",
       "       258,\n",
       "       233.99998,\n",
       "       257,\n",
       "       233.99998,\n",
       "       256,\n",
       "       233.99998,\n",
       "       255,\n",
       "       233.99998,\n",
       "       254,\n",
       "       233.99998,\n",
       "       253,\n",
       "       233.99998,\n",
       "       247,\n",
       "       233.99998,\n",
       "       246,\n",
       "       233.99998,\n",
       "       245,\n",
       "       233.99998,\n",
       "       244,\n",
       "       233.99998,\n",
       "       243,\n",
       "       235.00002,\n",
       "       240,\n",
       "       235.00002,\n",
       "       239,\n",
       "       235.00002,\n",
       "       237,\n",
       "       235.00002,\n",
       "       236],\n",
       "      [235.00002, 225, 237, 226, 237, 225, 237, 219, 237, 218, 237, 217],\n",
       "      [235.00002, 210, 235.00002, 211]],\n",
       "     'confidence': 0.99},\n",
       "    'SkinNasolabialFoldRightPathPoints': {'value': [], 'confidence': 0.99},\n",
       "    'SkinNasolabialFolds_Left': {'value': 1, 'confidence': 0.99},\n",
       "    'SkinNasolabialFolds_Right': {'value': 0, 'confidence': 0.99},\n",
       "    'SkinPandaEye_Left': {'value': 1, 'confidence': 0.99},\n",
       "    'SkinPandaEye_Left_Artery': {'value': 3, 'confidence': 0.99},\n",
       "    'SkinPandaEye_Left_Artery_Have': {'value': 1, 'confidence': 0.99},\n",
       "    'SkinPandaEye_Left_Pigment': {'value': 0, 'confidence': 0.99},\n",
       "    'SkinPandaEye_Left_Pigment_Have': {'value': 0, 'confidence': 0.99},\n",
       "    'SkinPandaEye_Left_Shadow': {'value': 1, 'confidence': 0.99},\n",
       "    'SkinPandaEye_Left_Shadow_Have': {'value': 1, 'confidence': 0.99},\n",
       "    'SkinPandaEye_Right': {'value': 1, 'confidence': 0.99},\n",
       "    'SkinPandaEye_Right_Artery': {'value': 3, 'confidence': 0.99},\n",
       "    'SkinPandaEye_Right_Artery_Have': {'value': 1, 'confidence': 0.99},\n",
       "    'SkinPandaEye_Right_Pigment': {'value': 0, 'confidence': 0.99},\n",
       "    'SkinPandaEye_Right_Pigment_Have': {'value': 0, 'confidence': 0.99},\n",
       "    'SkinPandaEye_Right_Shadow': {'value': 1, 'confidence': 0.99},\n",
       "    'SkinPandaEye_Right_Shadow_Have': {'value': 1, 'confidence': 0.99},\n",
       "    'SkinPimple': {'value': 5,\n",
       "     'rectangle': [{'top': 181.9916,\n",
       "       'left': 328.16827,\n",
       "       'width': 4.1309433,\n",
       "       'height': 4.263444},\n",
       "      {'top': 301.12436,\n",
       "       'left': 262.9377,\n",
       "       'width': 3.963934,\n",
       "       'height': 3.988798},\n",
       "      {'top': 241.89067,\n",
       "       'left': 369.08936,\n",
       "       'width': 1.8621166,\n",
       "       'height': 1.9836379},\n",
       "      {'top': 42.541164,\n",
       "       'left': 287.8228,\n",
       "       'width': 4.2561407,\n",
       "       'height': 4.5925784},\n",
       "      {'top': 230.64557,\n",
       "       'left': 253.33707,\n",
       "       'width': 6.3362494,\n",
       "       'height': 6.125962}],\n",
       "     'confidence': 0.99},\n",
       "    'SkinRosaceaChin': {'value': 1, 'confidence': 0.99},\n",
       "    'SkinRosaceaForehead': {'value': 0, 'confidence': 0.99},\n",
       "    'SkinRosaceaLeftcheek': {'value': 0, 'confidence': 0.99},\n",
       "    'SkinRosaceaNose': {'value': 1, 'confidence': 0.99},\n",
       "    'SkinRosaceaRightcheek': {'value': 0, 'confidence': 0.99},\n",
       "    'SkinSpot': {'value': 20,\n",
       "     'rectangle': [{'top': 213.10124,\n",
       "       'left': 201.1225,\n",
       "       'width': 2.5087502,\n",
       "       'height': 2.8787498},\n",
       "      {'top': 129.6175, 'left': 375.89874, 'width': 2.23, 'height': 2.4675},\n",
       "      {'top': 204.465,\n",
       "       'left': 368.65125,\n",
       "       'width': 2.7875001,\n",
       "       'height': 2.8787498},\n",
       "      {'top': 221.73749,\n",
       "       'left': 225.37376,\n",
       "       'width': 3.0662503,\n",
       "       'height': 3.7012498},\n",
       "      {'top': 65.87375,\n",
       "       'left': 232.06375,\n",
       "       'width': 3.0662503,\n",
       "       'height': 3.2899997},\n",
       "      {'top': 129.20624,\n",
       "       'left': 295.61877,\n",
       "       'width': 3.0662503,\n",
       "       'height': 3.2899997},\n",
       "      {'top': 229.55124,\n",
       "       'left': 207.8125,\n",
       "       'width': 1.9512501,\n",
       "       'height': 2.4675},\n",
       "      {'top': 73.276245,\n",
       "       'left': 237.91751,\n",
       "       'width': 1.9512501,\n",
       "       'height': 2.0562499},\n",
       "      {'top': 198.70749, 'left': 368.93, 'width': 2.23, 'height': 2.0562499},\n",
       "      {'top': 181.02374,\n",
       "       'left': 283.35376,\n",
       "       'width': 2.23,\n",
       "       'height': 2.0562499},\n",
       "      {'top': 220.50374, 'left': 207.8125, 'width': 2.23, 'height': 2.4675},\n",
       "      {'top': 145.245,\n",
       "       'left': 279.45126,\n",
       "       'width': 3.0662503,\n",
       "       'height': 3.2899997},\n",
       "      {'top': 191.71625,\n",
       "       'left': 373.39005,\n",
       "       'width': 1.9512501,\n",
       "       'height': 2.0562499},\n",
       "      {'top': 311.38998,\n",
       "       'left': 303.98126,\n",
       "       'width': 1.9512501,\n",
       "       'height': 2.0562499},\n",
       "      {'top': 75.3325, 'left': 242.3775, 'width': 2.7875001, 'height': 2.4675},\n",
       "      {'top': 79.033745,\n",
       "       'left': 276.385,\n",
       "       'width': 3.3449998,\n",
       "       'height': 3.2899997},\n",
       "      {'top': 209.4, 'left': 320.985, 'width': 3.3449998, 'height': 3.2899997},\n",
       "      {'top': 249.29123,\n",
       "       'left': 335.75876,\n",
       "       'width': 3.6237502,\n",
       "       'height': 4.1124997},\n",
       "      {'top': 198.70749,\n",
       "       'left': 215.6175,\n",
       "       'width': 1.9512501,\n",
       "       'height': 1.6449999},\n",
       "      {'top': 86.43625,\n",
       "       'left': 249.625,\n",
       "       'width': 4.18125,\n",
       "       'height': 4.1124997}],\n",
       "     'confidence': 0.99},\n",
       "    'SkinType': {'value': 1, 'confidence': 0.99},\n",
       "    'TregionShinyRatio': {'value': 0, 'confidence': 0.99}},\n",
       "   'face_rectangle': {'height': 216.15465,\n",
       "    'left': 175.45331,\n",
       "    'top': 121.95089,\n",
       "    'width': 209.97644}}]}"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "face = i['media_extra']\n",
    "face"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "df = face['faces']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'face_attributes': {'BlackHead_Area': {'value': 0.0037664782721549273, 'confidence': 0.99}, 'CheekRedValue': {'value': 0, 'confidence': 0.99}, 'CrowsFeed_LeftArea': {'value': 0, 'confidence': 0.99}, 'CrowsFeed_RightArea': {'value': 0, 'confidence': 0.99}, 'EyeWrinkle_LeftArea': {'value': 0, 'confidence': 0.99}, 'EyeWrinkle_RightArea': {'value': 0, 'confidence': 0.99}, 'NasolabialFolds_LeftArea': {'value': 0.010450980626046658, 'confidence': 0.99}, 'NasolabialFolds_RightArea': {'value': 0, 'confidence': 0.99}, 'PoresBetweenBrow_Have': {'value': 0, 'confidence': 0.99}, 'PoresCheeks_Left': {'value': 0, 'confidence': 0.99}, 'PoresCheeks_Right': {'value': 0, 'confidence': 0.99}, 'PoresForehead_Have': {'value': 0, 'confidence': 0.99}, 'SkinAcne': {'value': 0, 'confidence': 0.99}, 'SkinAge': {'value': 25, 'confidence': 0.99}, 'SkinBlackHeads': {'value': 3, 'rectangle': [{'top': 200, 'left': 272, 'width': 1, 'height': 1.9999999}, {'top': 225, 'left': 299, 'width': 2, 'height': 0.99999994}, {'top': 227, 'left': 270, 'width': 1, 'height': 1.9999999}], 'confidence': 0.99}, 'SkinColorHueDelta': {'value': 2, 'confidence': 0.99}, 'SkinColorLevel': {'value': 3, 'confidence': 0.99}, 'SkinCrowFeetLeftPathPoints': {'value': [], 'confidence': 0.99}, 'SkinCrowFeetRightPathPoints': {'value': [], 'confidence': 0.99}, 'SkinCrowsFeed_Left': {'value': 0, 'confidence': 0.99}, 'SkinCrowsFeed_Right': {'value': 0, 'confidence': 0.99}, 'SkinEyeFineLineScore_Left': {'value': 0, 'confidence': 0.99}, 'SkinEyeFineLineScore_Right': {'value': 0, 'confidence': 0.99}, 'SkinEyeFineLine_Left': {'value': 0, 'confidence': 0.99}, 'SkinEyeFineLine_Right': {'value': 0, 'confidence': 0.99}, 'SkinEyeWrinkleLeftPathPoints': {'value': [], 'confidence': 0.99}, 'SkinEyeWrinkleRightPathPoints': {'value': [], 'confidence': 0.99}, 'SkinEyeWrinkle_Left': {'value': 0, 'confidence': 0.99}, 'SkinEyeWrinkle_Right': {'value': 0, 'confidence': 0.99}, 'SkinForeHeadWrinkle': {'value': 1, 'confidence': 0.99}, 'SkinForeHeadWrinkleArea': {'value': 0.0007254902157001197, 'confidence': 0.99}, 'SkinForeheadWrinklePathPoints': {'value': [[302, 95, 303, 95, 304, 95, 305, 95, 304, 95, 303, 95, 302, 95, 301, 95]], 'confidence': 0.99}, 'SkinHighlight': {'value': 0, 'confidence': 0.99}, 'SkinHighlightPrec': {'value': 0, 'confidence': 0.99}, 'SkinLevel': {'value': 34, 'confidence': 0.99}, 'SkinMole': {'value': 1, 'rectangle': [{'top': 258.87366, 'left': 347.68958, 'width': 4.6326084, 'height': 4.5779653}], 'confidence': 0.99}, 'SkinNasolabialFoldLeftPathPoints': {'value': [[233, 239, 232, 242, 232, 243, 232, 244, 232, 245, 232, 246, 232, 247, 232, 248, 232, 249, 232, 250, 232, 251, 231, 253, 230, 255, 231, 257, 233, 261, 233.99998, 262, 233.99998, 261, 233.99998, 260, 233.99998, 259, 233.99998, 258, 233.99998, 257, 233.99998, 256, 233.99998, 255, 233.99998, 254, 233.99998, 253, 233.99998, 247, 233.99998, 246, 233.99998, 245, 233.99998, 244, 233.99998, 243, 235.00002, 240, 235.00002, 239, 235.00002, 237, 235.00002, 236], [235.00002, 225, 237, 226, 237, 225, 237, 219, 237, 218, 237, 217], [235.00002, 210, 235.00002, 211]], 'confidence': 0.99}, 'SkinNasolabialFoldRightPathPoints': {'value': [], 'confidence': 0.99}, 'SkinNasolabialFolds_Left': {'value': 1, 'confidence': 0.99}, 'SkinNasolabialFolds_Right': {'value': 0, 'confidence': 0.99}, 'SkinPandaEye_Left': {'value': 1, 'confidence': 0.99}, 'SkinPandaEye_Left_Artery': {'value': 3, 'confidence': 0.99}, 'SkinPandaEye_Left_Artery_Have': {'value': 1, 'confidence': 0.99}, 'SkinPandaEye_Left_Pigment': {'value': 0, 'confidence': 0.99}, 'SkinPandaEye_Left_Pigment_Have': {'value': 0, 'confidence': 0.99}, 'SkinPandaEye_Left_Shadow': {'value': 1, 'confidence': 0.99}, 'SkinPandaEye_Left_Shadow_Have': {'value': 1, 'confidence': 0.99}, 'SkinPandaEye_Right': {'value': 1, 'confidence': 0.99}, 'SkinPandaEye_Right_Artery': {'value': 3, 'confidence': 0.99}, 'SkinPandaEye_Right_Artery_Have': {'value': 1, 'confidence': 0.99}, 'SkinPandaEye_Right_Pigment': {'value': 0, 'confidence': 0.99}, 'SkinPandaEye_Right_Pigment_Have': {'value': 0, 'confidence': 0.99}, 'SkinPandaEye_Right_Shadow': {'value': 1, 'confidence': 0.99}, 'SkinPandaEye_Right_Shadow_Have': {'value': 1, 'confidence': 0.99}, 'SkinPimple': {'value': 5, 'rectangle': [{'top': 181.9916, 'left': 328.16827, 'width': 4.1309433, 'height': 4.263444}, {'top': 301.12436, 'left': 262.9377, 'width': 3.963934, 'height': 3.988798}, {'top': 241.89067, 'left': 369.08936, 'width': 1.8621166, 'height': 1.9836379}, {'top': 42.541164, 'left': 287.8228, 'width': 4.2561407, 'height': 4.5925784}, {'top': 230.64557, 'left': 253.33707, 'width': 6.3362494, 'height': 6.125962}], 'confidence': 0.99}, 'SkinRosaceaChin': {'value': 1, 'confidence': 0.99}, 'SkinRosaceaForehead': {'value': 0, 'confidence': 0.99}, 'SkinRosaceaLeftcheek': {'value': 0, 'confidence': 0.99}, 'SkinRosaceaNose': {'value': 1, 'confidence': 0.99}, 'SkinRosaceaRightcheek': {'value': 0, 'confidence': 0.99}, 'SkinSpot': {'value': 20, 'rectangle': [{'top': 213.10124, 'left': 201.1225, 'width': 2.5087502, 'height': 2.8787498}, {'top': 129.6175, 'left': 375.89874, 'width': 2.23, 'height': 2.4675}, {'top': 204.465, 'left': 368.65125, 'width': 2.7875001, 'height': 2.8787498}, {'top': 221.73749, 'left': 225.37376, 'width': 3.0662503, 'height': 3.7012498}, {'top': 65.87375, 'left': 232.06375, 'width': 3.0662503, 'height': 3.2899997}, {'top': 129.20624, 'left': 295.61877, 'width': 3.0662503, 'height': 3.2899997}, {'top': 229.55124, 'left': 207.8125, 'width': 1.9512501, 'height': 2.4675}, {'top': 73.276245, 'left': 237.91751, 'width': 1.9512501, 'height': 2.0562499}, {'top': 198.70749, 'left': 368.93, 'width': 2.23, 'height': 2.0562499}, {'top': 181.02374, 'left': 283.35376, 'width': 2.23, 'height': 2.0562499}, {'top': 220.50374, 'left': 207.8125, 'width': 2.23, 'height': 2.4675}, {'top': 145.245, 'left': 279.45126, 'width': 3.0662503, 'height': 3.2899997}, {'top': 191.71625, 'left': 373.39005, 'width': 1.9512501, 'height': 2.0562499}, {'top': 311.38998, 'left': 303.98126, 'width': 1.9512501, 'height': 2.0562499}, {'top': 75.3325, 'left': 242.3775, 'width': 2.7875001, 'height': 2.4675}, {'top': 79.033745, 'left': 276.385, 'width': 3.3449998, 'height': 3.2899997}, {'top': 209.4, 'left': 320.985, 'width': 3.3449998, 'height': 3.2899997}, {'top': 249.29123, 'left': 335.75876, 'width': 3.6237502, 'height': 4.1124997}, {'top': 198.70749, 'left': 215.6175, 'width': 1.9512501, 'height': 1.6449999}, {'top': 86.43625, 'left': 249.625, 'width': 4.18125, 'height': 4.1124997}], 'confidence': 0.99}, 'SkinType': {'value': 1, 'confidence': 0.99}, 'TregionShinyRatio': {'value': 0, 'confidence': 0.99}}, 'face_rectangle': {'height': 216.15465, 'left': 175.45331, 'top': 121.95089, 'width': 209.97644}}\n"
     ]
    }
   ],
   "source": [
    "for w in df:\n",
    "    print(w)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'BlackHead_Area': {'value': 0.0037664782721549273, 'confidence': 0.99},\n",
       " 'CheekRedValue': {'value': 0, 'confidence': 0.99},\n",
       " 'CrowsFeed_LeftArea': {'value': 0, 'confidence': 0.99},\n",
       " 'CrowsFeed_RightArea': {'value': 0, 'confidence': 0.99},\n",
       " 'EyeWrinkle_LeftArea': {'value': 0, 'confidence': 0.99},\n",
       " 'EyeWrinkle_RightArea': {'value': 0, 'confidence': 0.99},\n",
       " 'NasolabialFolds_LeftArea': {'value': 0.010450980626046658,\n",
       "  'confidence': 0.99},\n",
       " 'NasolabialFolds_RightArea': {'value': 0, 'confidence': 0.99},\n",
       " 'PoresBetweenBrow_Have': {'value': 0, 'confidence': 0.99},\n",
       " 'PoresCheeks_Left': {'value': 0, 'confidence': 0.99},\n",
       " 'PoresCheeks_Right': {'value': 0, 'confidence': 0.99},\n",
       " 'PoresForehead_Have': {'value': 0, 'confidence': 0.99},\n",
       " 'SkinAcne': {'value': 0, 'confidence': 0.99},\n",
       " 'SkinAge': {'value': 25, 'confidence': 0.99},\n",
       " 'SkinBlackHeads': {'value': 3,\n",
       "  'rectangle': [{'top': 200, 'left': 272, 'width': 1, 'height': 1.9999999},\n",
       "   {'top': 225, 'left': 299, 'width': 2, 'height': 0.99999994},\n",
       "   {'top': 227, 'left': 270, 'width': 1, 'height': 1.9999999}],\n",
       "  'confidence': 0.99},\n",
       " 'SkinColorHueDelta': {'value': 2, 'confidence': 0.99},\n",
       " 'SkinColorLevel': {'value': 3, 'confidence': 0.99},\n",
       " 'SkinCrowFeetLeftPathPoints': {'value': [], 'confidence': 0.99},\n",
       " 'SkinCrowFeetRightPathPoints': {'value': [], 'confidence': 0.99},\n",
       " 'SkinCrowsFeed_Left': {'value': 0, 'confidence': 0.99},\n",
       " 'SkinCrowsFeed_Right': {'value': 0, 'confidence': 0.99},\n",
       " 'SkinEyeFineLineScore_Left': {'value': 0, 'confidence': 0.99},\n",
       " 'SkinEyeFineLineScore_Right': {'value': 0, 'confidence': 0.99},\n",
       " 'SkinEyeFineLine_Left': {'value': 0, 'confidence': 0.99},\n",
       " 'SkinEyeFineLine_Right': {'value': 0, 'confidence': 0.99},\n",
       " 'SkinEyeWrinkleLeftPathPoints': {'value': [], 'confidence': 0.99},\n",
       " 'SkinEyeWrinkleRightPathPoints': {'value': [], 'confidence': 0.99},\n",
       " 'SkinEyeWrinkle_Left': {'value': 0, 'confidence': 0.99},\n",
       " 'SkinEyeWrinkle_Right': {'value': 0, 'confidence': 0.99},\n",
       " 'SkinForeHeadWrinkle': {'value': 1, 'confidence': 0.99},\n",
       " 'SkinForeHeadWrinkleArea': {'value': 0.0007254902157001197,\n",
       "  'confidence': 0.99},\n",
       " 'SkinForeheadWrinklePathPoints': {'value': [[302,\n",
       "    95,\n",
       "    303,\n",
       "    95,\n",
       "    304,\n",
       "    95,\n",
       "    305,\n",
       "    95,\n",
       "    304,\n",
       "    95,\n",
       "    303,\n",
       "    95,\n",
       "    302,\n",
       "    95,\n",
       "    301,\n",
       "    95]],\n",
       "  'confidence': 0.99},\n",
       " 'SkinHighlight': {'value': 0, 'confidence': 0.99},\n",
       " 'SkinHighlightPrec': {'value': 0, 'confidence': 0.99},\n",
       " 'SkinLevel': {'value': 34, 'confidence': 0.99},\n",
       " 'SkinMole': {'value': 1,\n",
       "  'rectangle': [{'top': 258.87366,\n",
       "    'left': 347.68958,\n",
       "    'width': 4.6326084,\n",
       "    'height': 4.5779653}],\n",
       "  'confidence': 0.99},\n",
       " 'SkinNasolabialFoldLeftPathPoints': {'value': [[233,\n",
       "    239,\n",
       "    232,\n",
       "    242,\n",
       "    232,\n",
       "    243,\n",
       "    232,\n",
       "    244,\n",
       "    232,\n",
       "    245,\n",
       "    232,\n",
       "    246,\n",
       "    232,\n",
       "    247,\n",
       "    232,\n",
       "    248,\n",
       "    232,\n",
       "    249,\n",
       "    232,\n",
       "    250,\n",
       "    232,\n",
       "    251,\n",
       "    231,\n",
       "    253,\n",
       "    230,\n",
       "    255,\n",
       "    231,\n",
       "    257,\n",
       "    233,\n",
       "    261,\n",
       "    233.99998,\n",
       "    262,\n",
       "    233.99998,\n",
       "    261,\n",
       "    233.99998,\n",
       "    260,\n",
       "    233.99998,\n",
       "    259,\n",
       "    233.99998,\n",
       "    258,\n",
       "    233.99998,\n",
       "    257,\n",
       "    233.99998,\n",
       "    256,\n",
       "    233.99998,\n",
       "    255,\n",
       "    233.99998,\n",
       "    254,\n",
       "    233.99998,\n",
       "    253,\n",
       "    233.99998,\n",
       "    247,\n",
       "    233.99998,\n",
       "    246,\n",
       "    233.99998,\n",
       "    245,\n",
       "    233.99998,\n",
       "    244,\n",
       "    233.99998,\n",
       "    243,\n",
       "    235.00002,\n",
       "    240,\n",
       "    235.00002,\n",
       "    239,\n",
       "    235.00002,\n",
       "    237,\n",
       "    235.00002,\n",
       "    236],\n",
       "   [235.00002, 225, 237, 226, 237, 225, 237, 219, 237, 218, 237, 217],\n",
       "   [235.00002, 210, 235.00002, 211]],\n",
       "  'confidence': 0.99},\n",
       " 'SkinNasolabialFoldRightPathPoints': {'value': [], 'confidence': 0.99},\n",
       " 'SkinNasolabialFolds_Left': {'value': 1, 'confidence': 0.99},\n",
       " 'SkinNasolabialFolds_Right': {'value': 0, 'confidence': 0.99},\n",
       " 'SkinPandaEye_Left': {'value': 1, 'confidence': 0.99},\n",
       " 'SkinPandaEye_Left_Artery': {'value': 3, 'confidence': 0.99},\n",
       " 'SkinPandaEye_Left_Artery_Have': {'value': 1, 'confidence': 0.99},\n",
       " 'SkinPandaEye_Left_Pigment': {'value': 0, 'confidence': 0.99},\n",
       " 'SkinPandaEye_Left_Pigment_Have': {'value': 0, 'confidence': 0.99},\n",
       " 'SkinPandaEye_Left_Shadow': {'value': 1, 'confidence': 0.99},\n",
       " 'SkinPandaEye_Left_Shadow_Have': {'value': 1, 'confidence': 0.99},\n",
       " 'SkinPandaEye_Right': {'value': 1, 'confidence': 0.99},\n",
       " 'SkinPandaEye_Right_Artery': {'value': 3, 'confidence': 0.99},\n",
       " 'SkinPandaEye_Right_Artery_Have': {'value': 1, 'confidence': 0.99},\n",
       " 'SkinPandaEye_Right_Pigment': {'value': 0, 'confidence': 0.99},\n",
       " 'SkinPandaEye_Right_Pigment_Have': {'value': 0, 'confidence': 0.99},\n",
       " 'SkinPandaEye_Right_Shadow': {'value': 1, 'confidence': 0.99},\n",
       " 'SkinPandaEye_Right_Shadow_Have': {'value': 1, 'confidence': 0.99},\n",
       " 'SkinPimple': {'value': 5,\n",
       "  'rectangle': [{'top': 181.9916,\n",
       "    'left': 328.16827,\n",
       "    'width': 4.1309433,\n",
       "    'height': 4.263444},\n",
       "   {'top': 301.12436, 'left': 262.9377, 'width': 3.963934, 'height': 3.988798},\n",
       "   {'top': 241.89067,\n",
       "    'left': 369.08936,\n",
       "    'width': 1.8621166,\n",
       "    'height': 1.9836379},\n",
       "   {'top': 42.541164,\n",
       "    'left': 287.8228,\n",
       "    'width': 4.2561407,\n",
       "    'height': 4.5925784},\n",
       "   {'top': 230.64557,\n",
       "    'left': 253.33707,\n",
       "    'width': 6.3362494,\n",
       "    'height': 6.125962}],\n",
       "  'confidence': 0.99},\n",
       " 'SkinRosaceaChin': {'value': 1, 'confidence': 0.99},\n",
       " 'SkinRosaceaForehead': {'value': 0, 'confidence': 0.99},\n",
       " 'SkinRosaceaLeftcheek': {'value': 0, 'confidence': 0.99},\n",
       " 'SkinRosaceaNose': {'value': 1, 'confidence': 0.99},\n",
       " 'SkinRosaceaRightcheek': {'value': 0, 'confidence': 0.99},\n",
       " 'SkinSpot': {'value': 20,\n",
       "  'rectangle': [{'top': 213.10124,\n",
       "    'left': 201.1225,\n",
       "    'width': 2.5087502,\n",
       "    'height': 2.8787498},\n",
       "   {'top': 129.6175, 'left': 375.89874, 'width': 2.23, 'height': 2.4675},\n",
       "   {'top': 204.465,\n",
       "    'left': 368.65125,\n",
       "    'width': 2.7875001,\n",
       "    'height': 2.8787498},\n",
       "   {'top': 221.73749,\n",
       "    'left': 225.37376,\n",
       "    'width': 3.0662503,\n",
       "    'height': 3.7012498},\n",
       "   {'top': 65.87375,\n",
       "    'left': 232.06375,\n",
       "    'width': 3.0662503,\n",
       "    'height': 3.2899997},\n",
       "   {'top': 129.20624,\n",
       "    'left': 295.61877,\n",
       "    'width': 3.0662503,\n",
       "    'height': 3.2899997},\n",
       "   {'top': 229.55124, 'left': 207.8125, 'width': 1.9512501, 'height': 2.4675},\n",
       "   {'top': 73.276245,\n",
       "    'left': 237.91751,\n",
       "    'width': 1.9512501,\n",
       "    'height': 2.0562499},\n",
       "   {'top': 198.70749, 'left': 368.93, 'width': 2.23, 'height': 2.0562499},\n",
       "   {'top': 181.02374, 'left': 283.35376, 'width': 2.23, 'height': 2.0562499},\n",
       "   {'top': 220.50374, 'left': 207.8125, 'width': 2.23, 'height': 2.4675},\n",
       "   {'top': 145.245,\n",
       "    'left': 279.45126,\n",
       "    'width': 3.0662503,\n",
       "    'height': 3.2899997},\n",
       "   {'top': 191.71625,\n",
       "    'left': 373.39005,\n",
       "    'width': 1.9512501,\n",
       "    'height': 2.0562499},\n",
       "   {'top': 311.38998,\n",
       "    'left': 303.98126,\n",
       "    'width': 1.9512501,\n",
       "    'height': 2.0562499},\n",
       "   {'top': 75.3325, 'left': 242.3775, 'width': 2.7875001, 'height': 2.4675},\n",
       "   {'top': 79.033745,\n",
       "    'left': 276.385,\n",
       "    'width': 3.3449998,\n",
       "    'height': 3.2899997},\n",
       "   {'top': 209.4, 'left': 320.985, 'width': 3.3449998, 'height': 3.2899997},\n",
       "   {'top': 249.29123,\n",
       "    'left': 335.75876,\n",
       "    'width': 3.6237502,\n",
       "    'height': 4.1124997},\n",
       "   {'top': 198.70749,\n",
       "    'left': 215.6175,\n",
       "    'width': 1.9512501,\n",
       "    'height': 1.6449999},\n",
       "   {'top': 86.43625, 'left': 249.625, 'width': 4.18125, 'height': 4.1124997}],\n",
       "  'confidence': 0.99},\n",
       " 'SkinType': {'value': 1, 'confidence': 0.99},\n",
       " 'TregionShinyRatio': {'value': 0, 'confidence': 0.99}}"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = w['face_attributes']\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'value': 3, 'confidence': 0.99}"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 数据处理--提取肤色相关数据\n",
    "肤色明暗程度=df['SkinColorLevel']\n",
    "肤色明暗程度"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "* \"SkinColorLevel\":{\"value\": \"0\",\"confidence\": 1},肤色明暗程度分析结果,value值表示肤色明暗等级.\n",
    "\n",
    "* 范围为[1,6]间的整数, 请使用String 类型存取，明暗等级值具体表示如下:\n",
    "\n",
    "* \"1\":\"透白\", \"2\":\"白皙\", \"3\":\"自然\", \"4\":\"小麦\", \"5\":\"暗沉\", \"6\":\"黝黑\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'value': 34, 'confidence': 0.99}"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "潘通色肤色等级=df['SkinLevel']\n",
    "潘通色肤色等级"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "* \"SkinLevel\":{\"value\":\"72\",\"confidence\":1},pantone110肤色等级分析结果,value值表示pantone110肤色等级."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'value': 2, 'confidence': 0.99}"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "肤色色调=df['SkinColorHueDelta']\n",
    "肤色色调"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "* \"SkinColorHueDelta\":{\"value\": \"2\",\"confidence\": 1},肤色色调分析结果，value值表示肤色色调等级。\n",
    "\n",
    "* 范围为[0,2]间的整数,请使用String 类型存取，色调等级值具体表示如下:\n",
    "\n",
    "* \"0\":\"中性\",\"1\":\"偏黄\",\"2\":\"偏红\""
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
